import request from '@/utils/request.js'

/**
 * 坞修相关
 */

// 前置预生成坞修单(查三个月内的坞修单)
export const autoMateDockBeforeApi = (params) => request({ url: `/web/dockOrder/autoMateDockBefore`, method: 'get', params, loading: true })

// 导入坞修单
export const copyDockOrderApi = (data) => request({ url: `/web/dockOrder/copyDockOrder`, method: 'post', data, loading: true })

// 预生成坞修单
export const autoMateDockOrderApi = (data) => request({ url: `/web/dockOrder/autoMateDockOrder`, method: 'post', data })

// 修改坞修单
export const editApi = (data) => request({ url: `/web/dockOrder/edit`, method: 'post', data, loading: true })

// 回显坞修单
export const getDetailApi = (id) => request({ url: `/web/dockOrder/${id}`, method: 'get', loading: true })

// 删除坞修单
export const deleteDockOrderApi = (id) => request({ url: `/web/dockOrder/${id}`, method: 'DELETE', loading: true })

// 修改-增加坞修单明细
export const updateDockDetailApi = (data) => request({ url: `/web/dockOrder/updateDockDetail`, method: 'post', data, loading: true })

// 批量增加明细
export const batchInsertApi = (data) => request({ url: `/web/dockOrder/batchInsert`, method: 'post', data, loading: true })
// 批量增加明细（完工单）
export const finishOrderBatchInsertApi = (data) => request({ url: `/web/finishOrder/batchInsert`, method: 'post', data, loading: true })

// 附加项父级添加
export const insertAddOnApi = (data) => request({ url: `/web/dockOrder/insertAddOn`, method: 'post', data, loading: true })
// 附加项父级添加（完工单）
export const finishOrderInsertAddOnApi = (data) => request({ url: `/web/finishOrder/insertAddOn`, method: 'post', data, loading: true })

// 附加项管路 数据
export const getAddOnPipeAboutApi = (params) => request({ url: `/web/dockOrder/getAddOnPipeAbout`, method: 'get', params, loading: true })

// 附加项阀门 数据
export const getAddOnValvesAboutApi = (params) => request({ url: `/web/dockOrder/getAddOnValvesAbout`, method: 'get', params, loading: true })

// 附加项钢结构 数据
export const getAddOnSteelworkAboutApi = (params) => request({ url: `/web/dockOrder/getAddOnSteelworkAbout`, method: 'get', params, loading: true })

// 删除坞修单明细
export const deleteDetailApi = (params) => request({ url: `/web/dockOrder/deleteDetailPhysical`, method: 'get', params })

// 获取坞修项目信息（维修选项/项目类型）
export const getRepairInfoApi = (params) => request({ url: `/web/repairProject/getRepairInfo`, method: 'get', params })

// 根据小类获取所属大类所有信息（维修选项/项目类型）
export const getRepairListBySmallApi = (params) => request({ url: `/web/repairProject/getRepairListBySmall`, method: 'get', params, loading: true })

// 根据中类获取所属大类所有信息（维修选项/项目类型）
export const getRepairListByMediumApi = (params) => request({ url: `/web/repairProject/getRepairListByMedium`, method: 'get', params, loading: true })

// 查询维修附加项目列表
export const getRepairAddTreeApi = (params) => request({ url: `/web/project/getRepairAddTree`, method: 'get', params, loading: true })

// 查询维修关键词列表
export const repairKeywordsListApi = (params) => request({ url: `/web/repairKeywords/list`, method: 'get', params })

// 关键词批量添加
export const addKeywordBath = (data) => request({ url: `/web/dockOrder/addKeywordBath`, method: 'post', data, loading: true })

// 询价
export const invitationToQuoteApi = (data) => request({ url: `/web/dockOrder/invitationToQuote`, method: 'post', data, loading: true })

// 坞修单列表
export const dockOrderListApi = (params, data) => request({ url: `/web/dockOrder/selectShcwDockOrderList`, method: 'post', params, data, loading: true })

// 邀请报价坞修单
export const queryInvitedOrderApi = (params, data) => request({ url: `/web/dockOrder/queryInvitedOrder`, method: 'post', params, data, loading: true })

// 分配报价员
export const headOfDistributionApi = (params) => request({ url: `/web/dockOrder/headOfDistribution`, method: 'get', params })

// 在线报价 （生成报价单id）
export const onlineQuoteApi = (params) => request({ url: `/web/dockQuotation/onlineQuote`, method: 'get', params })

// 查询报价单详情
export const queryQuotationByIdApi = (params) => request({ url: `/web/dockQuotation/queryQuotationById`, method: 'get', params, loading: true })

// 查询报价单详情(船东)
export const viewOuotationApi = (params) => request({ url: `/web/dockQuotation/viewOuotation`, method: 'get', params, loading: true })

// 查询报价重要单价列表
export const quotoImportancePriceListApi = (params) => request({ url: `/web/quotoImportancePrice/list`, method: 'get', params })

// 保存报价单
export const saveQuotationApi = (data) => request({ url: `/web/dockQuotation/saveQuotation`, method: 'post', data, loading: true })

// 修改报价单明细
export const updateQuotoDetailApi = (data) => request({ url: `/web/dockQuotation/updateQuotoDetail`, method: 'post', data, loading: true })

// 提交报价单（详情
export const submitQuotationApi = (data) => request({ url: `/web/dockQuotation/submitQuotation`, method: 'post', data, loading: true })

// 提交报价单（列表
export const submitInListApi = (params) => request({ url: `/web/dockQuotation/submitInList`, method: 'get', params, loading: true })

// 查看报价前置校验
export const viewBeforeApi = (data) => request({ url: `/web/dockQuotation/viewBefore`, method: 'post', data, loading: true })

// 查询收到的报价列表
export const dockQuotationQueryReceiveQuotaApi = (params, data) => request({ url: `/web/dockQuotation/queryReceiveQuota`, method: 'post', params, data, loading: true })

// 参与投标
export const joinBidApi = (params) => request({ url: `/web/dockQuotation/joinBid`, method: 'get', params, loading: true })

// 拒绝投标（放弃投标）
export const rejectionBidApi = (data) => request({ url: `/web/dockQuotation/rejectionBid`, method: 'post', data, loading: true })

// 确认中标操作
export const confirmQuotationApi = (data) => request({ url: `/web/dockQuotation/confirmQuotation`, method: 'post', data, loading: true })

// 发布的报价单
export const selectShcwQuotationDockOrderListApi = (params, data) => request({ url: `/web/dockQuotation/selectShcwQuotationDockOrderList`, method: 'post', params, data, loading: true })

// 接受中标
export const acceptanceQuotationApi = (params) => request({ url: `/web/dockQuotation/acceptanceQuotation`, method: 'get', params, loading: true })

// 拒绝中标
export const refusalQuotationApi = (data) => request({ url: `/web/dockQuotation/refusalQuotation`, method: 'post', data, loading: true })

// 生成完工单
export const preGenerateFinishApi = (params) => request({ url: `/web/finishOrder/preGenerateFinish`, method: 'get', params })

// 完工单 查询完工单列表
export const getFinishOrderListApi = (params, data) => request({ url: `/web/finishOrder/list`, method: 'post', params, data, loading: true })

// 获取完工单详细信息
export const getFinishOrderDetailApi = (id) => request({ url: `/web/finishOrder/${id}`, method: 'get', loading: true })

// 完工单 明细修改 新增
export const updateShcwFinishOrderDetailApi = (data) => request({ url: `/web/finishOrder/updateShcwFinishOrderDetail`, method: 'post', data, loading: true })

// 完工单 删除明细
export const deleteDetailPhysicalApi = (params) => request({ url: `/web/finishOrder/deleteDetailPhysical`, method: 'get', params, loading: true })

// 保存完工单
export const saveFinishOrderApi = (data) => request({ url: `/web/finishOrder/edit`, method: 'post', data, loading: true })

// 导出完工单
export const exportFinishOrderApi = (params, data) => request({ url: `/web/finishOrder/exportFinishOrder`, method: 'post', params, data, loading: true, responseType: 'blob' })

// 完工单 同步需求方
export const synchronizedDemandSideApi = (params) => request({ url: `/web/finishOrder/synchronizedDemandSide`, method: 'get', params, loading: true })

// 收到的账单
export const receivedFinishOrderApi = (params, data) => request({ url: `/web/finishOrder/receivedFinishOrder`, method: 'post', params, data, loading: true })

// 授权经营代表或修船总管
export const operatesOrRepairChargeApi = (data) => request({ url: `/web/finishOrder/operatesOrRepairCharge`, method: 'post', data, loading: true })

// 可评价列表
export const queryAwaitingEvaluationApi = (params, data) => request({ url: `/web/dockQuotation/queryAwaitingEvaluation`, method: 'post', params, data, loading: true })

// 在线比价-坞修报价
export const dockQuoteCompareApi = (data) => request({ url: `/web/comparePrice/dockQuoteCompare`, method: 'post', data })

// 导出报价
export const exportDockQuoteApi = (params) => request({ url: `/web/dockQuotation/exportDockQuote`, method: 'post', params, responseType: 'blob', loading: true })

// 坞修报价单中船舶列表
export const getQuotaOrderShipApi = (data) => request({ url: `/web/dockQuotation/getQuotaOrderShip`, method: 'post', data: data || {} })

// 坞修邀请报价中船舶列表
export const queryInvitedShipApi = (data) => request({ url: `/web/dockOrder/queryInvitedShip`, method: 'post', data: data || {} })

// 发布后编辑
export const inviteEditingApi = (params) => request({ url: `/web/dockQuotation/inviteEditing`, method: 'post', params })

// 邀请报价记录
export const queryQuoteRecordApi = (params) => request({ url: `/web/dockOrder/queryQuoteRecord`, method: 'get', params })
